package com.ourteam.product.model.api;

import org.apache.commons.lang3.StringUtils;

import com.ourteam.frame.web.AbstractSearchModel;
import com.ourteam.product.model.dao.IProductModelPackageDAO;
import com.ourteam.product.model.dao.ProductModelPackageDAOQueryBean;
import com.ourteam.product.model.dao.ProductModelServiceDAOQueryBean;
import com.ourteam.product.model.domain.ProductModelServiceBean;

public class ProductModelServiceSearchModel extends AbstractSearchModel<ProductModelServiceDAOQueryBean> {

	private Long serviceObjectId;

	@Override
	public String getMappedDAOField(String aProperty) {
		return ProductModelServiceBean.getMappedDAOField(aProperty);
	}

	@Override
	protected void doBuildQueryBean(ProductModelServiceDAOQueryBean queryBean) throws Exception {

		ProductModelServiceDAOQueryBean.Criteria criteria = queryBean.createCriteria();

		if (serviceObjectId != null && serviceObjectId != 0) {
			criteria.andObjectIdEqualTo(serviceObjectId);
		}
	}

	public Long getServiceObjectId() {
		return serviceObjectId;
	}

	public void setServiceObjectId(Long serviceObjectId) {
		this.serviceObjectId = serviceObjectId;
	}

}
